package com.gitee.huxing.proxy;

import java.lang.reflect.Proxy;
import java.util.Arrays;
import java.util.List;

/**
 * @Description:
 * @ProjectName: AlgorithmicPactice
 * @Package: com.gitee.huxing.proxy
 * @ClassName: TestMain
 * @Author: huxing
 * @DateTime: 2022-04-01 2:07 PM
 */
public class TestMain {

    public static void main(String[] args) {
        TestService service = new TestServiceImpl();
        service = (TestService) Proxy.newProxyInstance(TestMain.class.getClassLoader(),
                new Class[]{TestService.class}, new MoneyCountInvocationHandler(service));
        service.sendMessage("这是一条测试的短信消息内容: 1234");
        service.sendMessage("这是一条测试的短信消息内容: 5678");
        String str = "[1, 2, 3, 4, 5, 6]";
        List<String> list = Arrays.asList(Arrays.copyOfRange(str.split(","), 1, str.length() - 1));
        System.out.println(list.toString());
    }
}
